package com.zkw.group.service;

import com.zkw.group.entity.CourseRelation;
import com.zkw.group.mapper.CourseRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseRelationService {

    @Autowired
    private CourseRelationMapper courseRelationMapper;

    //分页获取课程先修后修关系列表
    public List<CourseRelation> getAllCourseRelationList(String relacname, String courseid, int pageStart, int pageSize){
        return courseRelationMapper.getAllCourseRelationList(relacname,courseid,pageStart,pageSize);
    }

    //获取课程先修后修关系条目数
    public int getCourseRelationCounts(String relacname,String courseid){
        return  courseRelationMapper.getCourseRelationCounts(relacname,courseid);
    }

    //添加课程先修后修关系
    public int addCourseRelation(CourseRelation courseRelation){
        return courseRelationMapper.addCourseRelation(courseRelation);
    }

    //删除课程先修后修关系
    public int deleteCourseRelation(String courseid,String relacname){
        return courseRelationMapper.deleteCourseRelation(courseid,relacname);
    }

}
